// 定义配置相关信息

import { getSystemConfigInfo } from '@/services/config'

export default {
  namespace: 'config',
  state: {
    // 存储各个系统不同配置
    configInfo: {}
  },
  reducers: {
    setConfigInfo(state, { payload }) {
      return {
        ...state,
        configInfo: payload
      }
    }
  },
  effects: {
    *getConfigInfo({ payload }, { call, put }) {
      const { data } = call(getSystemConfigInfo, payload)
      yield put({ type: 'setConfigInfo', payload: data })
    }
  }
}
